package com.xydtech.ecard.ftp.enums;

/**
 * @Author: liliya
 * @Description:
 * ftp_deposit_loan_rate_config
 *   `config_name` varchar(10) DEFAULT NULL COMMENT '期限中文名称'
 * @Date: Created in 2023/8/16 19:36
 * @Modified:
 */

public enum FtpDepositLoanRateConfigKeyYearTypeEnum {

    Y_1("1年","1Y",1),
    Y_2("2年","2Y",2),
    Y_3("3年","3Y",3),
    Y_4("4年","3Y",4),
    Y_5("5年","5Y",5),
    Y_6("6年","5Y",6),
    Y_7("7年","5Y",7),
    Y_8("8年","5Y",8),
    Y_9("9年","5Y",9),
    Y_10("10年","10Y",10),
    Y_11("11年","10Y",11),
    Y_12("12年","10Y",12),
    Y_13("13年","10Y",13),
    Y_14("14年","10Y",14),
    Y_15("15年","15Y",15),
    Y_16("16年","15Y",16),
    Y_17("17年","15Y",17),
    Y_18("18年","15Y",18),
    Y_19("19年","15Y",19),
    Y_20("20年","20Y",20),
    Y_30("30年","30Y",30);

    private String configName;
    private String configKey;
    private Integer number;

    FtpDepositLoanRateConfigKeyYearTypeEnum(String configName, String configKey, Integer number) {
        this.configName = configName;
        this.configKey = configKey;
        this.number = number;
    }

    public String getConfigName() {
        return configName;
    }

    public String getConfigKey() {
        return configKey;
    }

    public Integer getNumber() {
        return number;
    }

    public static FtpDepositLoanRateConfigKeyYearTypeEnum valuesByKey(String key){
        for(FtpDepositLoanRateConfigKeyYearTypeEnum enums : FtpDepositLoanRateConfigKeyYearTypeEnum.values()){
            if(enums.getConfigKey().equals(key)){
                return enums;
            }
        }
        return null;
    }

    public static FtpDepositLoanRateConfigKeyYearTypeEnum valuesByNumber(Integer numVal){
        for(FtpDepositLoanRateConfigKeyYearTypeEnum enums : FtpDepositLoanRateConfigKeyYearTypeEnum.values()){
            if(enums.getNumber().equals(numVal)){
                return enums;
            }
        }
        return null;
    }

}
